package com.ruoyi.web.controller.flowable;

import org.flowable.ui.common.repository.UuidIdGenerator;
import org.flowable.ui.common.service.idm.RemoteIdmService;
import org.flowable.ui.common.service.idm.RemoteIdmServiceImpl;
import org.flowable.ui.common.tenant.DefaultTenantProvider;
import org.flowable.ui.common.tenant.TenantProvider;
import org.flowable.ui.modeler.repository.*;
import org.flowable.ui.modeler.service.*;
import org.flowable.ui.modeler.serviceapi.AppDefinitionService;
import org.flowable.ui.modeler.serviceapi.ModelService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MyFlowableConfiguration {

    @Bean
    public ModelService modelService() {
        return new ModelServiceImpl();
    }

    @Bean
    public ModelImageService modelImageService() {
        return new ModelImageService();
    }

    @Bean
    public ModelRepository modelRepository() {
        return new ModelRepositoryImpl();
    }

    @Bean
    public UuidIdGenerator uuidIdGenerator() {
        return new UuidIdGenerator();
    }

    @Bean
    public TenantProvider tenantProvider() {
        return new DefaultTenantProvider();
    }

    @Bean
    public ModelHistoryRepository modelHistoryRepository() {
        return new ModelHistoryRepositoryImpl();
    }

    @Bean
    public ModelRelationRepository modelRelationRepository() {
        return new ModelRelationRepositoryImpl();
    }

    @Bean
    public AppDefinitionImportService appDefinitionImportService() {
        return new AppDefinitionImportService();
    }

    @Bean
    public AppDefinitionExportService appDefinitionExportService() {
        return new AppDefinitionExportService();
    }

    @Bean
    public AppDefinitionPublishService appDefinitionPublishService() {
        return new AppDefinitionPublishService();
    }

    @Bean
    public AppDefinitionService appDefinitionService() {
        return new AppDefinitionServiceImpl();
    }

    @Bean
    public FlowableModelQueryService flowableModelQueryService() {
        return new FlowableModelQueryService();
    }

    @Bean
    public FlowableCaseModelService flowableCaseModelService() {
        return new FlowableCaseModelService();
    }

    @Bean
    public FlowableDecisionServiceService flowableDecisionServiceService() {
        return new FlowableDecisionServiceService();
    }

    @Bean
    public FlowableDecisionTableService flowableDecisionTableService() {
        return new FlowableDecisionTableService();
    }

    @Bean
    public BpmnDisplayJsonConverter bpmnDisplayJsonConverter() {
        return new BpmnDisplayJsonConverter();
    }

    @Bean
    public CmmnDisplayJsonConverter cmmnDisplayJsonConverter() {
        return new CmmnDisplayJsonConverter();
    }

    @Bean
    public DmnDisplayJsonConverter dmnDisplayJsonConverter() {
        return new DmnDisplayJsonConverter();
    }

    @Bean
    public RemoteIdmService remoteIdmService() {
        return new RemoteIdmServiceImpl();
    }

    @Bean
    public ModelRelationService modelRelationService() {
        return new ModelRelationService();
    }

    @Bean
    public FlowableFormService flowableFormService() {
        return new FlowableFormService();
    }
}
